home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-14 | 12.0 KB | 526 lines | [TEXT/MPS ] |
- /*
- File: SamplePart.r
-
- Contains: SamplePart Resources
-
- Written by: Steve Smith
-
- Copyright: © 1994-95 by Apple Computer, Inc., all rights reserved.
- */
-
- #define SystemSevenOrBetter 1 // we want the extended types
- #define SystemSevenOrLater 1 // Types.r uses this variable
-
- // -- MPW Rez Includes --
-
- #include "Types.r"
- #include "SysTypes.r"
- #include "CodeFragmentTypes.r"
-
- // -- OpenDoc Includes --
-
- #ifndef __ODTYPES_R__
- #include "ODTypes.r"
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdDefs_defined
- #include "StdDefs.r"
- #endif
-
- // -- SamplePart Includes --
-
- #ifndef _SAMPLEPARTDEF_
- #include "SamplePartDef.h"
- #endif
-
- #ifndef _SAMPLEPARTVERS_
- #include "SamplePartVers.h"
- #endif
-
- //-------------------------------------------------------------------------------------
- // .rsrc resources
- //-------------------------------------------------------------------------------------
-
- // SamplePart - This gets the resources from my .rsrc file (PICTs etc.)
- include "SamplePartOtherResources.rsrc";
-
- //-------------------------------------------------------------------------------------
- // Finder Version Resources
- //-------------------------------------------------------------------------------------
-
- // Part's Finder Version Resource
-
- resource 'vers' (1) {
- currentMajorVersion,
- finderMinorVersion,
- developmentStage,
- preReleaseNumber,
- verUS,
- shortVersionStr,
- shortVersionStr", © Apple Computer, Inc. 1994-1995"
- };
-
- resource 'vers' (2) {
- currentMajorVersion,
- finderMinorVersion,
- developmentStage,
- preReleaseNumber,
- verUS,
- shortVersionStr,
- "OpenDoc™ Sample Code"
- };
-
- //-------------------------------------------------------------------------------------
- // Code Fragment Resources
- //-------------------------------------------------------------------------------------
-
- resource 'cfrg' (0) {
- { /* [1] */
- #ifdef _68KBUILD_
- kMotorola,
- #else
- kPowerPC,
- #endif
- kFullLib,
- currentVersion,
- compatibleVersion,
- kDefaultStackSize,
- kNoAppSubFolder,
- kIsLib,
- kOnDiskFlat,
- kZeroOffset,
- kWholeFork,
- kSamplePartID, /* This must be the class ID. */
- /* [2] */
- #ifdef _68KBUILD_
- kMotorola,
- #else
- kPowerPC,
- #endif
- kFullLib,
- currentVersion,
- compatibleVersion,
- kDefaultStackSize,
- kNoAppSubFolder,
- kIsLib,
- kOnDiskFlat,
- kZeroOffset,
- kWholeFork,
- kPartClassName /* This must be the SOM class name */
- /* for this part. */
- }
- };
-
- //-------------------------------------------------------------------------------------
- // NMAP Resources
- //-------------------------------------------------------------------------------------
-
- // Map a part's class id (module::classname)
- // to a part's kind (unique content identifier)
- //
- resource kODNameMappings (kEditorKindMapId) {
- kODEditorKinds,
- { /* array Types: 1 elements */
- /* [1] */
- kSamplePartID,
- kODIsAnISOStringList
- {
- { /* array ClassIDs: 1 elements */
- /* [1] */
- kSamplePartKind
- }
- }
- }
- };
-
- // Map a part's class id (module::classname)
- // to a human readable string.
- //
- resource kODNameMappings (kEditorUserStringMapId) {
- kODEditorUserString,
- { /* array Types: 1 elements */
- /* [1] */
- kSamplePartID,
- kODIsINTLText
- {
- smRoman,
- langEnglish,
- kSamplePartEditorUserString
- }
- }
- };
-
- // Map a part's kind (unique content identifier)
- // to a generic content category identifier.
- //
- resource kODNameMappings (kKindCategoryMapId) {
- kODKind,
- { /* array Types: 1 elements */
- /* [1] */
- kSamplePartKind,
- kODIsAnISOStringList
- {
- { /* array ClassIDs: 1 elements */
- /* [1] */
- kSamplePartCategory
- }
- }
- }
- };
-
- // Map a part's kind (unique content identifier)
- // to a human readable string.
- //
- resource kODNameMappings (kKindUserStringMapId) {
- kODKindUserString,
- { /* array Types: 1 elements */
- /* [1] */
- kSamplePartKind,
- kODIsINTLText
- {
- smRoman,
- langEnglish,
- kSamplePartKindUserString
- }
- }
- };
-
- // Map a part's generic content category identifier
- // to a human readable string.
- //
- resource kODNameMappings (kCategoryUserStringMapId) {
- kODCategoryUserString,
- { /* array KeyList: 1 elements */
- /* [1] */
- kSamplePartCategory,
- kODIsINTLText {
- smRoman,
- langEnglish,
- kSamplePartCategoryUserString
- }
- }
- };
-
- // Map a part's kind (unique content identifier)
- // to an old style MacOS Type (and/or ScrapType).
- //
- resource kODNameMappings (kOldMacOSTypeMapId) {
- kODKindOldMacOSType,
- { /* array KeyList: 1 elements */
- /* [1] */
- kSamplePartKind,
- kODIsMacOSType {
- kSamplePartDocumentOSType
- }
- }
- };
-
- //-------------------------------------------------------------------------------------
- // OLE Interoperability Support
- //-------------------------------------------------------------------------------------
-
- // This resource allows your editor to be registered with the OLE runtime on the
- // Macintosh and subsequently interoperate with OLE clients/servers. Contact Microsoft
- // to acqiure a unique class ID.
- resource 'olcr' (0, "OLE Class ID")
- {
- "{80C11F40-7503-8576-00D01113F11}"; /* your part's CLSID */
- };
-
- //-------------------------------------------------------------------------------------
- // String List Resources
- //-------------------------------------------------------------------------------------
-
- resource 'STR#' (kMenuStringResID, "Menu Items strings") {
- { /* array StringArray: 3 elements */
- /* [1] */
- "About SamplePart…",
- /* [2] */
- "PART",
- /* [3] */
- "Sample • Sample"
- }
- };
-
- resource 'STR#' (kErrorStringResID, "Error strings") {
- { /* array StringArray: 6 elements */
- /* [1] */
- "“SamplePart” was unable completely initi"
- "alize its internal structures.",
- /* [2] */
- "“SamplePart” was unable to open the docu"
- "ment due to unforseen circumstances.",
- /* [3] */
- "“SamplePart” was unable to open a part w"
- "indow due to unforseen circumstances.",
- /* [4] */
- "“SamplePart” has been asked to remove a "
- "frame that does not belong to it, or an "
- "error occurred while removing the frame "
- "from internal storage.",
- /* [5] */
- "A window that “SamplePart” created has b"
- "een deleted without its knowledge. This "
- "may generate a fatal error in the near f"
- "uture. Please close the document immedia"
- "tely to prevent data loss.",
- /* [6] */
- "“SamplePart” encountered a fatal error w"
- "hile trying to save. Try saving again or"
- " closing the document."
- }
- };
-
- //-------------------------------------------------------------------------------------
- // Finder Related Resources
- //-------------------------------------------------------------------------------------
-
- // Kind resources affect the text Finder displays in the
- // "kind" column and file info dialog. This feature was
- // introduced as part of Macintosh Easy Open.
- //
- resource 'kind' (kBaseResourceID) {
- kSamplePartEditorOSType,
- 0, /* region = USA */
- {
- 'shlb', "OpenDoc™ editor"
- }
- };
-
- resource 'kind' (kBaseResourceID+1) {
- kSamplePartViewerOSType,
- 0, /* region = USA */
- {
- 'shlb', "OpenDoc™ viewer"
- }
- };
-
- resource 'kind' (kBaseResourceID+2) {
- kODShellSignature,
- 0, /* region = USA */
- {
- kSamplePartDocumentOSType, "SamplePart 1.1 document",
- kSamplePartStationeryOSType, "SamplePart 1.1 stationery"
- }
- };
-
- // The -16397 string will be displayed by Finder when a user
- // tries to open the editor shared library. The string should
- // give the user a little detail about the part's capabilities
- // and enough information to install the part in the correct location.
- //
- resource 'STR ' (-16397, purgeable) {
- "OpenDoc™ editor\n\n“SamplePart” demonstrates the functionality of a very "
- "basic part. To work properly, it should be placed in the Editors folder. "
- "To create a new document, open a stationery pad."
- };
-
- //-------------------------------------------------------------------------------------
- // Dialog Resources
- //-------------------------------------------------------------------------------------
-
- resource 'DLOG' (kAboutBoxID, "SamplePart About Box") {
- {0, 0, 250, 350},
- dBoxProc,
- invisible,
- goAway,
- 0x0,
- kAboutBoxID,
- "",
- alertPositionMainScreen
- };
-
- resource 'DITL' (kAboutBoxID) {
- { /* array DITLarray: 8 elements */
- /* [1] */
- {222, 270, 242, 338}, Button { enabled, "OK" },
- /* [2] */
- {24, 25, 56, 57}, Icon { disabled, kEditorIconPicture },
- /* [3] */
- {13, 68, 237, 69}, Button { disabled, "" },
- /* [4] */
- {64, 13, 65, 337}, Button { disabled, "" },
- /* [5] */
- {46, 76, 62, 172}, StaticText { disabled, "SamplePart" },
- /* [6] */
- {76, 76, 116, 304}, StaticText { disabled,
- "SamplePart is a sample part editor which"
- " illustrates the functionality of a basi"
- "c part editor." },
- /* [7] */
- {124, 76, 152, 304}, StaticText { disabled,
- "Written by Steve Smith with support from"
- " the OpenDoc™ Engineering team." },
- /* [8] */
- {172, 76, 200, 300}, StaticText { disabled,
- "Copyright© 1994 - 1996 by Apple Computer, "
- "Inc. All Rights Reserved." },
- /* [9] */
- {51, 272, 64, 340}, StaticText { disabled,
- "Version "shortVersionStr }
- }
- };
-
- resource 'dctb' (kAboutBoxID) {
- /* dialog background fill color */
- { /* array ColorSpec: 5 elements */
- /* [1] */
- wContentColor, 59127, 59127, 59127,
- /* [2] */
- wFrameColor, 0, 0, 0,
- /* [3] */
- wTextColor, 0, 0, 0,
- /* [4] */
- wHiliteColor, 0, 0, 0,
- /* [5] */
- wTitleBarColor, 65535, 65535, 65535
- }
- };
-
- data 'ictb' (kAboutBoxID) {
- /* dialog control text styling */
- $"0000000000000000002800240028"
- $"004C80070074800700888007009C"
- $"800700B0800700C4000000000000"
- $"000300007FFF7FFF7FFF0001FFFF"
- $"FFFFFFFF00020000000000000003"
- $"FFFFFFFFFFFF0000000000000003"
- $"00007FFF7FFF7FFF0001FFFFFFFF"
- $"FFFF00020000000000000003FFFF"
- $"FFFFFFFF00D80100000E00000000"
- $"0000FFFFFFFFFFFF000000E10000"
- $"0009000000000000FFFFFFFFFFFF"
- $"000000E800000009000000000000"
- $"FFFFFFFFFFFF000000EF00000009"
- $"000000000000FFFFFFFFFFFF0000"
- $"00F600000009000000000000FFFF"
- $"FFFFFFFF00000850616C6174696E"
- $"6F0647656E6576610647656E6576"
- $"610647656E6576610647656E6576"
- $"61"
- };
-
- resource 'DLOG' (kErrorBoxID, "SamplePart Error Box") {
- {57, 46, 244, 374},
- dBoxProc,
- invisible,
- goAway,
- 0x0,
- kErrorBoxID,
- "",
- alertPositionParentWindowScreen
- };
-
- resource 'DITL' (kErrorBoxID) {
- { /* array DITLarray: 5 elements */
- /* [1] */
- {153, 256, 173, 314}, Button { enabled, "OK" },
- /* [2] */
- {153, 185, 173, 243}, Button { enabled, "Cancel" },
- /* [3] */
- {11, 70, 124, 317}, StaticText { disabled,
- "<< Use this for errors in the Editor, su"
- "ch as out of memory, unable to acquire s"
- "ome system resource, etc.>> \nUser errors"
- " use a standard alert appearance. See DI"
- "TL 129.>>" },
- /* [4] */
- {11, 19, 43, 51}, Icon { disabled, kEditorIconPicture },
- /* [5] */
- {149, 252, 177, 318}, UserItem { disabled }
- }
- };
-
- //-------------------------------------------------------------------------------------
- // Finder Bundle Information
- //-------------------------------------------------------------------------------------
-
- resource 'BNDL' (kDocumentBundle, "Document BNDL") {
- kODShellSignature,
- 0,
- { /* array TypeArray: 2 elements */
- /* [1] */
- 'FREF',
- { /* array IDArray: 2 elements */
- /* [1] */
- 0, kDocumentFREF,
- /* [2] */
- 1, kStationeryFREF
- },
- /* [2] */
- 'ICN#',
- { /* array IDArray: 2 elements */
- /* [1] */
- 0, kDocumentIcons,
- /* [2] */
- 1, kStationeryIcons
- }
- }
- };
-
- resource 'BNDL' (kEditorBundle, "Editor BNDL") {
- kSamplePartEditorOSType,
- 0,
- { /* array TypeArray: 2 elements */
- /* [1] */
- 'FREF',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, kEditorFREF
- },
- /* [2] */
- 'ICN#',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, kEditorIcons
- }
- }
- };
-
- resource 'BNDL' (kViewerBundle, "Viewer BNDL") {
- kSamplePartViewerOSType,
- 0,
- { /* array TypeArray: 2 elements */
- /* [1] */
- 'FREF',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, kViewerFREF
- },
- /* [2] */
- 'ICN#',
- { /* array IDArray: 1 elements */
- /* [1] */
- 0, kViewerIcons
- }
- }
- };
-
- resource 'FREF' (kDocumentFREF) {
- kSamplePartDocumentOSType, 0, ""
- };
-
- resource 'FREF' (kStationeryFREF) {
- kSamplePartStationeryOSType, 1, ""
- };
-
- resource 'FREF' (kEditorFREF) {
- 'shlb', 0, ""
- };
-
- resource 'FREF' (kViewerFREF) {
- 'shlb', 0, ""
- };
-
- data kODShellSignature (0, "Owner resource") {
- $"00"
- };
-
- data kSamplePartViewerOSType (0, "Owner resource") {
- $"00"
- };
-
- data kSamplePartEditorOSType (0, "Owner resource") {
- $"00"
- };
-